<?php
class Account_Model extends TinyMVC_Model
{
	function login($email, $pwd){
		$email = trim($email); $pwd = trim($pwd);
		if(trim($email)=='' || trim($pwd) == ''){
			return -1;
		}else{
			$sql = "SELECT * FROM `account`
			WHERE email='{$email}' AND pwd = '{$pwd}'";
			$data = $this->db->query_one($sql);
			return $data;
		}
	}
	
	function findall(){
		$sql = "SELECT * FROM `account`";
		return $this->db->query_all($sql);
	}
}
?>